package com.xaaef.jvm;

/**
 * Classfile /C:/Users/smile/projects/JavaProjects/jvm-demo/out/production/chapter4/com/xaaef/jvm/PCRegisterTest.class
 *   Last modified 2022-2-17; size 718 bytes
 *   MD5 checksum a751900676afc3279ab265cacd053ace
 *   Compiled from "PCRegisterTest.java"
 * public class com.xaaef.jvm.PCRegisterTest
 *   minor version: 0
 *   major version: 52
 *   flags: ACC_PUBLIC, ACC_SUPER
 * Constant pool:
 *    #1 = Methodref          #7.#27         // java/lang/Object."<init>":()V
 *    #2 = String             #28            // hello
 *    #3 = Fieldref           #29.#30        // java/lang/System.out:Ljava/io/PrintStream;
 *    #4 = Methodref          #31.#32        // java/io/PrintStream.println:(I)V
 *    #5 = Methodref          #31.#33        // java/io/PrintStream.println:(Ljava/lang/String;)V
 *    #6 = Class              #34            // com/xaaef/jvm/PCRegisterTest
 *    #7 = Class              #35            // java/lang/Object
 *    #8 = Utf8               <init>
 *    #9 = Utf8               ()V
 *   #10 = Utf8               Code
 *   #11 = Utf8               LineNumberTable
 *   #12 = Utf8               LocalVariableTable
 *   #13 = Utf8               this
 *   #14 = Utf8               Lcom/xaaef/jvm/PCRegisterTest;
 *   #15 = Utf8               main
 *   #16 = Utf8               ([Ljava/lang/String;)V
 *   #17 = Utf8               args
 *   #18 = Utf8               [Ljava/lang/String;
 *   #19 = Utf8               i
 *   #20 = Utf8               I
 *   #21 = Utf8               j
 *   #22 = Utf8               s
 *   #23 = Utf8               str
 *   #24 = Utf8               Ljava/lang/String;
 *   #25 = Utf8               SourceFile
 *   #26 = Utf8               PCRegisterTest.java
 *   #27 = NameAndType        #8:#9          // "<init>":()V
 *   #28 = Utf8               hello
 *   #29 = Class              #36            // java/lang/System
 *   #30 = NameAndType        #37:#38        // out:Ljava/io/PrintStream;
 *   #31 = Class              #39            // java/io/PrintStream
 *   #32 = NameAndType        #40:#41        // println:(I)V
 *   #33 = NameAndType        #40:#42        // println:(Ljava/lang/String;)V
 *   #34 = Utf8               com/xaaef/jvm/PCRegisterTest
 *   #35 = Utf8               java/lang/Object
 *   #36 = Utf8               java/lang/System
 *   #37 = Utf8               out
 *   #38 = Utf8               Ljava/io/PrintStream;
 *   #39 = Utf8               java/io/PrintStream
 *   #40 = Utf8               println
 *   #41 = Utf8               (I)V
 *   #42 = Utf8               (Ljava/lang/String;)V
 * {
 *   public com.xaaef.jvm.PCRegisterTest();
 *     descriptor: ()V
 *     flags: ACC_PUBLIC
 *     Code:
 *       stack=1, locals=1, args_size=1
 *          0: aload_0
 *          1: invokespecial #1                  // Method java/lang/Object."<init>":()V
 *          4: return
 *       LineNumberTable:
 *         line 3: 0
 *       LocalVariableTable:
 *         Start  Length  Slot  Name   Signature
 *             0       5     0  this   Lcom/xaaef/jvm/PCRegisterTest;
 *
 *   public static void main(java.lang.String[]);
 *     descriptor: ([Ljava/lang/String;)V
 *     flags: ACC_PUBLIC, ACC_STATIC
 *     Code:
 *       stack=2, locals=5, args_size=1
 *          0: iconst_1
 *          1: istore_1
 *          2: bipush        10
 *          4: istore_2
 *          5: iload_1
 *          6: iload_2
 *          7: iadd
 *          8: istore_3
 *          9: ldc           #2                  // String hello
 *         11: astore        4
 *         13: getstatic     #3                  // Field java/lang/System.out:Ljava/io/PrintStream;
 *         16: iload_1
 *         17: invokevirtual #4                  // Method java/io/PrintStream.println:(I)V
 *         20: getstatic     #3                  // Field java/lang/System.out:Ljava/io/PrintStream;
 *         23: iload_3
 *         24: invokevirtual #4                  // Method java/io/PrintStream.println:(I)V
 *         27: getstatic     #3                  // Field java/lang/System.out:Ljava/io/PrintStream;
 *         30: aload         4
 *         32: invokevirtual #5                  // Method java/io/PrintStream.println:(Ljava/lang/String;)V
 *         35: return
 *       LineNumberTable:
 *         line 6: 0
 *         line 7: 2
 *         line 8: 5
 *         line 9: 9
 *         line 11: 13
 *         line 13: 20
 *         line 15: 27
 *         line 16: 35
 *       LocalVariableTable:
 *         Start  Length  Slot  Name   Signature
 *             0      36     0  args   [Ljava/lang/String;
 *             2      34     1     i   I
 *             5      31     2     j   I
 *             9      27     3     s   I
 *            13      23     4   str   Ljava/lang/String;
 * }
 * SourceFile: "PCRegisterTest.java"
 * */

public class PCRegisterTest {

    public static void main(String[] args) {
        int i = 1;
        int j = 10;
        int s = i + j;
        String str = "hello";

        System.out.println(i);

        System.out.println(s);

        System.out.println(str);
    }

}
